from sqlalchemy import Column, DateTime, Integer, func

from app.database.models.base import Base


class Statistics(Base):
    __tablename__ = "stats"

    id = Column(Integer, primary_key=True)
    day = Column(DateTime, unique=True, server_default=func.now())
    mobile_proxies_bought = Column(Integer, server_default="0")
    server_proxies_bought = Column(Integer, server_default="0")
    payments_payed = Column(Integer, server_default="0")
    messages_sent = Column(Integer, server_default="0")
    subscriptions = Column(Integer, server_default="0")
    vpns = Column(Integer, server_default="0")

    def __repr__(self):
        return f"<Stats №{self.id} {self.day}>"
